import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import '@/assets/css/reset.css'
import '@/assets/css/common.less'

import ElementUI from 'element-ui';
import './styles/element-variables.scss'
import './styles/index.scss'
// 全局修改默认配置，点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false
ElementUI.Dialog.props.center.default = true
ElementUI.Dialog.props.appendToBody.default = true
ElementUI.MessageBox.setDefaults({
  closeOnClickModal: false,
  closeOnPressEscape: false
})
Vue.use(ElementUI, {size: 'small'});
// import '@/assets/css/table.less'
import '@/assets/css/pagination.less'
import '@/assets/css/collapse.less'
import '@/assets/css/el-dialog.less'
import '@/assets/css/index.scss'

//webSockte
import wsConnection from './vuex/wsSore.js'
//挂载vue原型链
Vue.prototype.$setWs = wsConnection;

import moment from 'moment'

Vue.prototype.$moment = moment

//数组删除指定元素
Array.prototype.indexOf = function (val) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] == val) return i;
  }
  return -1;
};
Array.prototype.remove = function (val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
};

import * as echarts from 'echarts'

Vue.prototype.$echarts = echarts

import api from './api'

Vue.prototype.$api = api

// 拖拽弹弹窗
import elDragDialog from '@/directive/el-drag-dialog'

Vue.use(elDragDialog)
import LoadingBox from '@/components/LoadingBox'
import Btn from '@/components/Btn'

Vue.component('LoadingBox', LoadingBox)
Vue.component('YtBtn', Btn)

import './permission'
import './icons' // icon

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
